﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/YUIAspNet.Master" CodeBehind="Button.aspx.cs" Inherits="YUIAspNetDemo.Button" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function PushAction(sender, args)
        {   
            alert("Text: "+sender.get_Text());
            args.cancel = true; // prevent postback
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    Push button(executes client side commands): <br />
    <yui:Button ID="btnClientSide" Text="Do client action" OnClientClick="PushAction" runat="server" />
    <hr />
    <asp:UpdatePanel ID="pnl" runat="server">
        <ContentTemplate>
            <asp:Label ID="lblTime" runat="server"></asp:Label>
            <yui:Button ID="btnCallback" Text="Postback inside update panel" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <hr />
    Button with postback:<br />
    <asp:Label ID="lblTimePB" runat="server"></asp:Label><br />
    <yui:Button ID="btnPostback" Text="Regular postback" runat="server" />
    <hr />
    And here's a link button, to navigate to another web page.<br />
    <yui:Button ID="btnLink" Text="Go to google" Target="_blank" ButtonType="Link" NavigateUrl="http://www.google.com" runat="server" />
    <hr />
    Very easy to customize the button. The text property allows html, so you can add images or anything you'd like.<br />
    <yui:Button ID="Button1" Text="<i>Go to</i> <b>yahoo</b>" Target="_blank" ButtonType="Link" NavigateUrl="http://www.yahoo.com" runat="server" />
     
</asp:Content>
